package com.servlet;

public class Mypoint {
    int id;
    double x;
    double y;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getX() {
        return x;
    }

    public void setX(double x) {
        this.x = x;
    }

    public double getY() {
        return y;
    }

    public void setY(double y) {
        this.y = y;
    }

    public Mypoint() {
    }
    public Mypoint(Mypoint mypoint,int x) {
        this.x= mypoint.x/x;
        this.y= mypoint.y/x;
    }
    public Mypoint(double x, double y) {
        this.x = x;
        this.y = y;
    }
    public void add(Mypoint mypoint)
    {
        this.x+= mypoint.x;
        this.y+= mypoint.y;
    }
    public void sub(Mypoint mypoint){
        this.x-= mypoint.x;
        this.y-= mypoint.y;
    }

    public Mypoint(int id, double x, double y) {
        this.id = id;
        this.x = x;
        this.y = y;
    }

    @Override
    public String toString() {
        return "Mypoint{" +
                "x=" + x +
                ", y=" + y +
                '}';
    }
}
